﻿<!DOCTYPE html>
<html>
<head>
    <title>dsoframer-demo</title>
    <meta charset="UTF-8" />
    <script src="script.js" type="text/javascript"></script>
    <style type="text/css">
        body {
            font-size: 12px;
        }

        input, label, select {
            margin: 1px;
        }

            input[type="button"], label, select {
                width: 118px;
                font-size: 12px;
            }

            input[type="text"] {
                width: 114px;
                font-size: 12px;
            }
    </style>
</head>
<body onload="InitEvent()">
    <div>
        <table width="100%">
            <tr>
                <td width="120px" style="vertical-align: top;">
                    <label>
                        菜单操作
                    </label>
                    <input type="button" value="显示标题栏" onclick="ToggleTitlebar()" />
                    <input type="button" value="显示菜单栏" onclick="ToggleMenubar()" />
                    <input type="button" value="显示工具栏" onclick="ToggleToolbars()" />
                    <label>
                        基本操作
                    </label>
                    <input type="button" value="新建文档" onclick="NewDoc()" />
                    <input type="button" value="打开文档" onclick="OpenDoc()" />
                    <input type="button" value="文档另存" onclick="SaveCopyDoc()" />
                    <input type="button" value="页面设置" onclick="ChgLayout()" />
                    <input type="button" value="文档打印" onclick="PrintDoc()" />
                    <input type="button" value="文档属性" onclick="OpenProperty()" />
                    <input type="button" value="关闭文档" onclick="CloseDoc()" />
                    <label>
                        Excel相关
                    </label>
                    <input type="button" value="新建Excel" onclick="AddNewExcel()" />
                    <label>
                        PPT相关
                    </label>
                    <input type="button" value="新建PPT" onclick="AddNewPPT()" />
                </td>
                <td width="120px" style="vertical-align: top;">
                    <label>
                        Word相关
                    </label>
                    <input type="button" value="新建Word" onclick="AddNewWord()" />
                    <input type="button" value="保留痕迹" onclick="ToggleTrackRevisions(true)" />
                    <input type="button" value="取消痕迹" onclick="ToggleTrackRevisions(false)" />
                    <input type="button" value="显示痕迹" onclick="ToggleShowRevisions(true)" />
                    <input type="button" value="隐藏痕迹" onclick="ToggleShowRevisions(false)" />
                    <input type="button" value="接受修订" onclick="ToggleAllRevisions(true)" />
                    <input type="button" value="拒绝修订" onclick="ToggleAllRevisions(false)" />
                    <input type="button" value="设置当前用户" onclick="SetUserName()" />
                    <input type="text" id="tUserName" value="stone" />
                    <input type="button" value="格式加锁" onclick="ProtectDoc(2)" />
                    <input type="button" value="全文加锁" onclick="ProtectDoc(3)" />
                    <input type="button" value="全部解锁" onclick="UnProtectDoc()" />
                    <select id="sViewMode" onchange="SetViewMode()">
                        <option value="1">普通视图</option>
                        <option value="2">大纲视图</option>
                        <option value="3">页面视图</option>
                        <option value="4">打印预览视图</option>
                        <option value="6">Web视图</option>
                        <option value="7">阅读视图</option>
                    </select>
                    <select id="sPageFit" onchange="SetPageFit()">
                        <option value="1">一页显示</option>
                        <option value="2">页宽显示</option>
                        <option value="3">内容居中</option>
                    </select>
                    <input type="button" value="动态套红" onclick="AddDocHeader('测试模板标题')" />
                    <input type="button" value="插入图片" onclick="InsertPicture()" />
                    <input type="button" value="显示功能区" onclick="ToggleRibbonBar()" />
                    <input type="button" value="无格式粘贴" onclick="CopyWithoutFormat()" />
                    <input type="button" value="获取书签数量" onclick="GetBookmarksCount()" />
                    <input type="button" value="遍历书签内容" onclick="GetBookmarksCount()" />
                </td>
                <td>
                    <object classid="clsid:00460182-9E5E-11d5-B7C8-B8269041DD57" id="oframe" width="100%"
                            height="800px" codebase="ActiveX/DSOframer/DSOframer.CAB#version=1,0,0,0">
                        <param name="BorderStyle" value="1" />
                        <param name="TitlebarColor" value="52479" />
                        <param name="TitlebarTextColor" value="0" />
                        <param name="Menubar" value="1" />
                        <param name="Titlebar" value="0" />
                        <param name="Menubar" value="0" />
                    </object>
                    <div style="display: none">
                        <!-- dsoframe事件 开始 -->
                        <script type="text/javascript" language="jscript" for="oframe" event="OnDocumentOpened(str,obj)">
                            OnDocumentOpened(str, obj);
                        </script>
                        <script type="text/javascript" language="jscript" for="oframe" event="OnDocumentClosed()">
                            OnDocumentClosed();
                        </script>
                        <!-- dsoframe事件 结束 -->
                    </div>
                </td>
            </tr>
        </table>
        <hr />
       <strong>如该Demo不能正常运行，请先手动注册DSOframer控件，具体方法请参考文章：</strong>
	   <br/>
	   <a href="https://my.oschina.net/liuyuantao/blog/843449" target="_blank">DSOframer的简单介绍和资源整理</a>
	   <br/>
	   <a href="https://my.oschina.net/liuyuantao/blog/843440" target="_blank">DSOframer注册说明及无法正常加载的解决方案</a>
    </div>
</body>
</html>